import { Component, OnInit } from '@angular/core';
import {Ranking} from "./ranking";
import {RankingService} from "./ranking.service";

@Component({
  selector: 'app-ranking',
  templateUrl: './ranking.component.html',
  styleUrls: ['./ranking.component.css']
})
export class RankingComponent implements OnInit {

  constructor(
    private rankService:RankingService
  ) { }

  ngOnInit(): void {
    this.getNewsList()
  }

  rankList:Ranking[]=[]

  getNewsList(){
    this.rankService.getHttpRankList().subscribe(data=>(this.rankList=data))
  }

}
